﻿using FNN.Networks;
using FNN.Options;
using System;

namespace FNN.Factories.Networks
{
    public class NetworkFactory
    {
        public static Network CreateNetwork(NetworkTypes networkType, NetworkOptions options)
        {
            Network result = null;
            switch (networkType)
            {
                case NetworkTypes.Financial:
                    result = new FinancialNetwork(options.InputCount, options.LayerCount, options.LayerNeuronsCount, options.Functions, options.OutputCount);
                    break;
                case NetworkTypes.Regular:
                    result = new RegularNetwork(options.InputCount, options.LayerCount, options.LayerNeuronsCount, options.Functions, options.OutputCount);
                    break;
                default:
                    throw new ArgumentOutOfRangeException("networkType", "Unknown network type!");
            }
            return result;
        }

        public static Network CreateRandomNetwork(NetworkTypes networkType)
        {
            Network result = null;
            switch (networkType)
            {
                case NetworkTypes.Financial:
                    result = new FinancialNetwork();
                    break;
                case NetworkTypes.Regular:
                    result = new RegularNetwork();
                    break;
                default:
                    throw new ArgumentOutOfRangeException("networkType", "Unknown network type!");
            }
            return result;
        }
    }
}
